<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="服务器配置"
    targetNamespace="codemonk.common.config.xsd"
    xmlns="codemonk.common.config.xsd" elementFormDefault="qualified"
    xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="codemonk">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="configpatterns" type="configpatterns" minOccurs="0" maxOccurs="1"/>
        <xs:element name="objectbuilders"  type="objectbuilders"  minOccurs="0" maxOccurs="1"/>
        <xs:element name="connectionstrings"  type="connectionstrings"  minOccurs="0" maxOccurs="1"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:complexType name="objectbuilders">
    <xs:sequence>
      <xs:element name="objectbuilder" minOccurs="1" maxOccurs="64">
        <xs:complexType>
          <xs:attribute name="name" type="xs:string"   />
          <xs:attribute name="classpath"  type="xs:string" />
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="connectionstrings">
    <xs:sequence>
      <xs:element name="connectionstring" minOccurs="1" maxOccurs="64">
        <xs:complexType>
          <xs:attribute name="name" type="xs:string"  use="required" />
          <xs:attribute name="value"  type="xs:string" use="required" />
          <xs:attribute name="providerinvariantname"  type="xs:string" use="required" />
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="configpatterns">
    <xs:sequence>
      <xs:element name="configpattern"  minOccurs="2" maxOccurs="2">
        <xs:complexType>
          <xs:attribute name="name">
            <xs:simpleType>
              <xs:restriction base="xs:string">
                <xs:enumeration value="assembly"/>
                <xs:enumeration value="type"/>
              </xs:restriction>
            </xs:simpleType>
          </xs:attribute>
          <xs:attribute name="pattern">
            <xs:simpleType>
              <xs:restriction base="xs:string">
                <xs:pattern value=".*\{0\}.*"/>
              </xs:restriction>
            </xs:simpleType>
          </xs:attribute>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

</xs:schema>